import type { BodyType } from './basic'

export const defaultWithIMix: IMix = {
  id: -1,
  moduleId: -1,
  environmentId: -1,
  databaseId: -1,
  name: '默认名称',
  description: '无描述',
  type: '',
  engineType: 'MIX',
  level: 'p0',
  path: '/',
  method: 'GET',
  query: '[]',
  rest: '[]',
  header: '[]',
  body: '[]',
  bodyType: 'JSON',
  operationType: '',
  locationType: '',
  locationExpress: '',
  elementWait: 0,
  targetLocationType: '',
  targetLocationExpress: '',
  targetElementWait: 0,
  value: '',
  expectKey: '',
  expectValue: '',
  isContinue: false,
  isScreenshot: false,
  sqlText: '',
  isRetry: false,
  retryType: "同步",
  retryCount: 1,
  retryFirstInterval: 3,
  startProxy: false,
  proxyId: null,
  createAccountId: '',
  updateAccountId: '',
  saveKey: '',
  gmtCreate: new Date(),
  gmtModified: new Date(),
}

export interface IMix {
  id: number
  moduleId: number
  environmentId: number
  databaseId: number
  name: string
  description?: string
  type: string
  engineType: string
  level: 'p0' | 'p1' | 'p2' | 'p3'
  path: string
  method: string
  query: string
  rest: string
  header: string
  body: string
  bodyType: BodyType
  locationType: string
  locationExpress: string
  operationType: string
  elementWait: number
  targetLocationType: string
  targetLocationExpress: string
  targetElementWait: number
  value: string
  expectKey: string
  expectValue: string
  isContinue: boolean
  isScreenshot: boolean
  sqlText: string
  isRetry: boolean
  retryType: string
  retryCount: number
  retryFirstInterval: number
  startProxy: boolean,
  proxyId: number | null,
  createAccountId: string
  updateAccountId: string
  saveKey: string
  gmtCreate: Date
  gmtModified: Date
}

export interface IOperation {
    id: number
    category: string
    categoryName: string
    name: string
    value: string
    extend: string
    remark: null // waiting backend
  }
  